<?php

if(!defined('IN_ECS'))
{
	die('Hacking attempt');
}

function gmtime()
{
	return (time() - date('Z'));
}

function local_date($format,$time = NULL)
{
	$timezone = isset($_SESSION['timezone']) 
				? $_SESSION['timezone']
				:$GLOBALS['_CFG']['timezone'];
				
	if($time === NULL)
	{
		$time = gmtime();
	}
	elseif($time <=0)
	{
		return '';
	}
	
	$time += ($timezone * 3600);
	
	return date($format,$time);
}
